﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TasksManagerService.cs" company="JaguarLabs">
//   JaguarLabs 2013
// </copyright>
// <summary>
//   Used to provide the service interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TasksManagerService
{
    using System;
    using System.Collections.Generic;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using TasksManagerServices.Value_Objects.Services;
    using TasksManagerServices.ValueObjects;
    using System.ServiceModel.Activation;

    /// <summary>
    /// Used to provide the service interface.
    /// </summary>
    [ServiceContract]
    public interface ITasksManagerService
    {
        /// <summary>
        /// Gets the user tasks.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(
            Method = "POST",
            UriTemplate = "/GetUserTasks",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        IEnumerable<Task> GetUserTasks(string user);

        /// <summary>
        /// Gets the user tasks.
        /// </summary>
        /// <param name="taskId">The task id.</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/GetTaskDetails",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        Task GetTaskDetails(string taskId);

        /// <summary>
        /// Inserts the task.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="endDateStr">The end date STR.</param>
        /// <param name="priorityId">The priority id.</param>
        /// <param name="notificationDateStr">The notification date STR.</param>
        /// <param name="projectId">The project id.</param>
        /// <param name="progress">The progress.</param>
        /// <param name="showInCalendar">if set to <c>true</c> [show in calendar].</param>
        /// <param name="users">The users.</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/InsertTask",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        InsertResponse InsertTask(string name, string description, string endDateStr, string priorityId,
                                  string notificationDateStr, string projectId, string progress, string showInCalendar,
                                  string users);

        /// <summary>
        /// Updates the task.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="endDateStr">The end date STR.</param>
        /// <param name="priorityId">The priority id.</param>
        /// <param name="notificationDateStr">The notification date STR.</param>
        /// <param name="projectId">The project id.</param>
        /// <param name="progress">The progress.</param>
        /// <param name="showInCalendar">if set to <c>true</c> [show in calendar].</param>
        /// <param name="users">The users.</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/UpdateTask",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        UpdateResponse UpdateTask(string id, string name, string description, string endDateStr, string priorityId,
                                  string notificationDateStr, string projectId, string progress, string showInCalendar,
                                  string users);

        /// <summary>
        /// Creates the project.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/CreateProject",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        InsertResponse CreateProject(string name);

        /// <summary>
        /// Deletes the task.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/DeleteTask",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        UpdateResponse DeleteTask(string id);

        /// <summary>
        /// Gets the projects.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/GetProjects",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        IEnumerable<Project> GetProjects();

        /// <summary>
        /// Gets the projects.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/GetPriorities",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        IEnumerable<Priority> GetPriorities();

        /// <summary>
        /// Gets the projects.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/GetUsers",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        IEnumerable<User> GetUsers();
    }
}